package state;

import context.Zh0202GamePlayer;

/**
 * @author: zh
 * @date: 2021/12/16 20:49
 * @version: 1.0
 */
public class Zh0202Primary extends Zh0202Grade {
    public Zh0202Primary(Zh0202Grade grade) {
        this.gamePlayer=grade.gamePlayer;
        this.score = grade.getScore();
        System.out.println("很遗憾，您已经掉段至入门级");
    }

    public Zh0202Primary(Zh0202GamePlayer gamePlayer) {
        this.score = 0;
        this.gamePlayer = gamePlayer;
        System.out.println("你现在是一名玩家了！！");
    }

    @Override
    public boolean play() {
        return super.play();
    }

    @Override
    public void checkGrade() {
        if (this.score >= 100) {
            gamePlayer.setGrade(new Zh0202Secondary(this));
            System.out.println("恭喜您，您已经升至熟练级");
        }
    }
}
